/*
Pic Resizer : an easy to use program to resize your pictures
Copyright (C) 2009  Kévin Gomez <geek63@gmail.com>

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

#ifndef MAINWINDOW_
#define MAINWINDOW_

#include <QtGui>

#include "ResizeDial.h"
#include "ProfilsManagerDial.h"
#include "ProfilesManager.h"

#define PROFILS_FILE QDir::home().absolutePath().append(QDir::separator()).append(".picresizer.conf")


class MainWindow : public QMainWindow
{
    Q_OBJECT

    public:
        MainWindow();

    public slots:
        void enableActions();
        void hMiror();
        void vMiror();
        void loadImage(QUrl);
        void imgToLabel();
        void rotateLeft();
        void rotateRight();
        void openDial();
        void save();
        void saveDial();
        void resizeDial();
        void resizeProfil();
        void profilsDial();
        void resizeAvatar();
        void fillProfilsList();

    signals:
        void imgDroped(QUrl img_url);
        void imgLoaded();
        void imgModified();

    private:
        void createActions();
        void createMenus();
        void createToolbar();
        //pour la drag'n'drop
        void dragEnterEvent(QDragEnterEvent *event);
        void dropEvent(QDropEvent *event);

        void rotate(int);

        QStatusBar *status_bar;
        QLabel *image_label;

        QAction *exit_act;
        QAction *open_act;
        QAction *save_act;
        QAction *save_as_act;
        QAction *h_miror_act;
        QAction *v_miror_act;
        QAction *l_rotate_act;
        QAction *r_rotate_act;
        QAction *resize_avatar_act;
        QAction *resize_dial_act;
        QAction *resize_profil_act;
        QAction *profils_dial_act;

        QComboBox *profils_w;

        QImage org_image;
        QImage cur_image;
        QString image_url;

        ProfilesManager *manager;
};

#endif /*MAINWINDOW_*/
